#ifndef __PID_H
#define __PID_H

typedef struct PID {

	double SetPoint;
	double P;
	double I;
	double D;
	double LastError;
	double PrevError;
	double SumError;

}PID;

extern bool pid_on;
extern PID sPID;

// PID
extern void   PIDInit(PID *pp, double P, double I, double D, double SetPoint);
extern double PIDCalc(PID *pp, double NextPoint);

#endif
